furny.entities
Class Tag

java.lang.Object
  extended by furny.entities.Tag
All Implemented Interfaces:
java.lang.Comparable<Tag>

@Entity
public class Tag
extends java.lang.Object
implements java.lang.Comparable<Tag>

A tag that describes a furniture annotation. This is a value object that is mapped by hibernate to a relational database.

Since:
10.08.2012
Author:
Stephan Dreyer

Field Summary
private  long id
           
private  java.lang.String name
           
private  TagType type
           
 
Constructor Summary
private Tag()
          Private constructor.
  Tag(TagType type, java.lang.String name)
          Constructor that creates a tag with type and name.
 
Method Summary
 int compareTo(Tag o)
           
 boolean equals(java.lang.Object obj)
           
 long getId()
          Getter for the id.
 java.lang.String getName()
          Getter for the name.
 TagType getType()
          Getter for the type.
 int hashCode()
           
private  void setId(java.lang.Long id)
          Private setter for the id.
 void setName(java.lang.String name)
          Setter for the name.
 void setType(TagType type)
          Setter for the type.
 java.lang.String toString()
           
static Tag valueOf(java.lang.String tagName)
          Factory method to parse a tag from a String.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

id

private long id

name

private java.lang.String name

type

private TagType type
Constructor Detail

Tag

private Tag()
Private constructor. Required by hibernate.

Since:
10.08.2012

Tag

public Tag(TagType type,
           java.lang.String name)
Constructor that creates a tag with type and name.

Parameters:
type - The type of the tag
name - The name of the tag
Since:
10.08.2012
Method Detail

getId

public long getId()
Getter for the id.

Returns:
The id.
Since:
10.08.2012

setId

private void setId(java.lang.Long id)
Private setter for the id. Required by hibernate.

Parameters:
id - The id.
Since:
10.08.2012

getType

public TagType getType()
Getter for the type.

Returns:
The type.
Since:
10.08.2012

setType

public void setType(TagType type)
Setter for the type.

Parameters:
type - The type.
Since:
10.08.2012

getName

public java.lang.String getName()
Getter for the name.

Returns:
The name.
Since:
10.08.2012

setName

public void setName(java.lang.String name)
Setter for the name.

Parameters:
name - The name.
Since:
10.08.2012

compareTo

public int compareTo(Tag o)
Specified by:
compareTo in interface java.lang.Comparable<Tag>

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

valueOf

public static Tag valueOf(java.lang.String tagName)
Factory method to parse a tag from a String.

Parameters:
tagName - String to parse.
Returns:
The created tag.
Since:
10.08.2012